<?php
/**
 * Created by PhpStorm.
 * User: sosyuki
 * Date: 2018/8/10
 * Time: 10:56
 */

namespace Drupal\points\MetadataController;


use EntityDefaultMetadataController;

class PointsTotalMetadataController extends EntityDefaultMetadataController {

  public function entityPropertyInfo() {
    $info = parent::entityPropertyInfo();
    $properties = &$info[$this->type]['properties'];

    $properties['type'] = [
        'type' => 'points_type',
        'required' => TRUE,
        'description' => t('积分类型.'),
      ] + $properties['type'];

    $properties['user'] = [
      'label' => t("User"),
      'type' => 'user',
      'description' => t("所属用户."),
      'required' => TRUE,
      'schema field' => 'uid',
    ];

    return $info;
  }
}
